/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package logic;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author beol
 */
public class Importer {
    private String login = "";

    public String getData(String login) {
        this.login = login;
        try {
            URL url = new URL("http://" + login + ".moikrug.ru");
            URLConnection connection = url.openConnection();
            BufferedReader bf = new BufferedReader(new InputStreamReader(connection.getInputStream(), "CP1251"));
            StringBuffer temp = new StringBuffer();
            while(bf.ready()) {
                temp.append(bf.readLine());
                //temp.append("\n");
            }

            //System.out.print(temp.toString());
            
        } catch (MalformedURLException ex) {
            Logger.getLogger(Importer.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Importer.class.getName()).log(Level.SEVERE, null, ex);
        }

        return "false";
    }

}
